package hn.cch.flink;// package hn.cch.flink;
//
// import com.ververica.cdc.connectors.mysql.source.MySqlSource;
// import com.ververica.cdc.debezium.JsonDebeziumDeserializationSchema;
// import org.apache.flink.api.common.eventtime.WatermarkStrategy;
// import org.apache.flink.configuration.Configuration;
// import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
//
// import java.util.Properties;
//
// public class FlinkCDC {
//
//     public static void main(String[] args) throws Exception {
//         Properties debeziumProperties = new Properties();
//         debeziumProperties.put("decimal.handling.mode", "String");
//         MySqlSource<String> mySqlSource = MySqlSource.<String>builder()
//             .hostname("localhost")
//             .port(3306)
//             .scanNewlyAddedTableEnabled(true)
//             .databaseList("user")
//             .tableList("user.user_1,user.user_2,user.user_3")
//             .username("root")
//             .password("chench")
//             .debeziumProperties(debeziumProperties)
//             .deserializer(new JsonDebeziumDeserializationSchema())
//             .build();
//
//         Configuration configuration = new Configuration();
//         // configuration.setString("execution.savepoint.path", "file:///tmp/flink-ck/1980d53f557a886f885172bcdf4be8e8/chk-21");
//         StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(configuration);
//         // env.enableCheckpointing(3000);
//         // env.getCheckpointConfig().setCheckpointStorage("file:///tmp/flink-ck");
//         env.fromSource(mySqlSource, WatermarkStrategy.noWatermarks(), "MySQL Source")
//         // set 4 parallel source tasks
//         // .setParallelism(4) // Source
//         // .setParallelism(1) // Sink
//         ;
//         env.execute("MySQL");
//
//     }
//
// }
